/**    
 * @{#} RoleUserRef.java Create on 2012-6-12 上午12:54:48    
 *    
 * Copyright (c) 2012 by 悠忧虫.    
 *    
 * @author 悠忧虫
 * @version 1.0    
 */
package tk.sunlatus.project.permission.domain;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

/**
 * @{# RoleUserRef.java Create on 2012-6-12 上午12:54:48
 * 
 *     类功能说明:
 * 
 *     <p>
 *     Copyright: Copyright(c) 2012
 *     </p>
 * @Version 1.0
 * @Author 悠忧虫
 */
public class RoleUserRef {

    private String id;
    private String roleID;
    private String userID;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        if (id == null) {
            throw new IllegalArgumentException("id can not be null.");
        }
        id = "ref_" + id;
        // TODO 常量定义 32转换
        if (id.length() > 32) {
            id = id.substring(0, 32);
        }
        this.id = id;
    }

    public String getRoleID() {
        return roleID;
    }

    public void setRoleID(String roleID) {
        this.roleID = roleID;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this);
    }

}
